package com.remainder.system.api;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.remainder.common.core.constant.ServiceNameConstants;
import com.remainder.common.core.domain.R;
import com.remainder.system.api.factory.RemoteConfigFallbackFactory;

/**
 * 系统配置
 *
 * @author wanggang
 */
@FeignClient(contextId = "remoteConfigService", value = ServiceNameConstants.SYSTEM_SERVICE,
    fallbackFactory = RemoteConfigFallbackFactory.class)
public interface RemoteConfigService {
    /**
     * 根据key值查询系统配置信息
     *
     * @param configKey
     *            系统配置key
     * @return R<String>
     */
    @GetMapping("/config/configKey/{configKey}")
    R<String> configInfoKey(@PathVariable("configKey") String configKey);

    /**
     * 根据字典类型查询字典数据信息
     *
     * @param dictType
     *            字典类型
     * @return 结果
     */
    @GetMapping(value = "/dict/data/getDictType")
    R<?> getDictType(@RequestParam("dictType") String dictType);

    /**
     * 执行日切
     *
     * @return 结果
     */
    @PostMapping("/config/updateDailyDate")
    R<?> updateDailyDate();
}
